#include "shadowfanmask.h"
#include <QDebug>

ShadowFanMask::ShadowFanMask(qreal x, qreal y, qreal width, qreal height, qreal startAngle, qreal spanAngle, QGraphicsItem *parent):
    QGraphicsItem(parent), x(x), y(y), width(width), height(height), startAngle(startAngle), spanAngle(spanAngle)
{

}


void ShadowFanMask::paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *widget){
    Q_UNUSED(option);
    Q_UNUSED(widget);
    painter->setBrush(QColor(128,128,128));
    painter->setOpacity(0.7);
    painter->setPen(QColor(128,128,128));
    painter->drawPie(boundingRect(),startAngle, spanAngle);
//    qDebug()<<"进行绘图";

}

QRectF ShadowFanMask::boundingRect() const
   {
       return QRectF(x, y, width, height);
   }
void ShadowFanMask::setAngle(qreal startAngle, qreal spanAngle){
    this->startAngle=startAngle;
    this->spanAngle=spanAngle;
}
